package com.serkol.constant;


public enum ResultCode {
    //消息

    MSG_CONTINUE(100, "msg.continue"),
    MSG_PROTOCALS(101, "msg.protocols"),
    MSG_PROCESSING(102, "msg.processing"),


    //成功
    OK(200, "ok.success"),
    OK_CREATED(201, "ok.created"),
    OK_ACCEPTED(202, "ok.accepted"),
    OK_NON_AUTHORITATIVE(203, "ok.nonauthoritative"),
    OK_CONTENT_NO(204, "contentno"),
    OK_(205, "contentreset"),
    OK_CONTENT_PARTIAL(206, "contentpartial"),
    OK_MULTI_STATUS(207, "multistatus"),


    //重定向 redirect
    REDIRECT_MULTIPLE_CHOICES(300, "redirect.multiplechoices"),
    REDIRECT_MOVED_PERMANENTLY(301, "redirect.permanently"),
    REDIRECT_MOVE_TEMPORARILY(302, "redirect.temporarily"),
    REDIRECT_SEE_OTHER(303, "redirect.seeother"),
    REDIRECT_NOT_MODIFIED(304, "redirect.notmodified"),
    REDIRECT_USE_PROXY(305, "redirect.useproxy"),
    REDIRECT_SWITCH_PROXY(306, "redirect.switchproxy"),
    REDIRECT_TEMPORARY_REDIRECT(307, "redirect.temporaryredirect"),


    //请求错误 request error

    REQUEST_ERROR_BAD(400, "request.error.bad"),//400 Bad Request
    REQUEST_ERROR_UNAUTHORIZED(401, "request.error.unauthorized"),// ▪ 401 Unauthorized
    REQUEST_ERROR_PAYMENT_REQUIRED(402, "request.error.paymentrequired"),// ▪ 402 Payment Required
    REQUEST_ERROR_FORBIDDEN(403, "request.error.forbidden"),// ▪ 403 Forbidden
    REQUEST_ERROR_NOT_FOUND(404, "request.error.notfound"),// ▪ 404 Not Found
    REQUEST_ERROR_NOT_METHOD_ALLOWED(405, "request.error.methodnotallowed"),// ▪ 405 Method Not Allowed
    REQUEST_ERROR_NOT_ACCEPTABLE(406, "request.error.notacceptable"),// ▪ 406 Not Acceptable
    REQUEST_ERROR_AUTHENTICATION_PROXY_REQUIRED(407, "request.error.proxyauthenticationrequired"),// ▪ 407 Proxy Authentication Required
    REQUEST_ERROR_TIMEOUT(408, "request.error.tomeout"),// ▪ 408 Request Timeout
    REQUEST_ERROR_CONFLICT(409, "request.error.conflict"),// ▪ 409 Conflict
    REQUEST_ERROR_GONE(410, "request.error.gone"),// ▪ 410 Gone
    REQUEST_ERROR_LENGTH_REQUIRED(411, "request.error.lengthrequired"),// ▪ 411 Length Required
    REQUEST_ERROR_PRECONDITION_FAILED(412, "request.error.preconditionfailed"),// ▪ 412 Precondition Failed
    REQUEST_ERROR_ENTITY_TOO_LARGE(413, "request.error.entitytoolarge"),// ▪ 413 Request Entity Too Large
    REQUEST_ERROR_URI_TOO_LONG(414, "request.error.uritoolong"),// ▪ 414 Request-URI Too Long
    REQUEST_ERROR_UNSUPORTED_MEDIA_TYPE(415, "request.error.unsuportedmediatype"),// ▪ 415 Unsupported Media Type
    REQUEST_ERROR_NOT_RANGE_NOT_SATISFIABLE(416, "request.error.rangenotsatisfiable"),// ▪ 416 Requested Range Not Satisfiable
    REQUEST_ERROR_EXPECTATION(417, "request.error.expectation"),// ▪ 417 Expectation Failed
    REQUEST_ERROR_TEAPOT(418, "request.error.teapot"),// ▪ 418 I'm a teapot
    REQUEST_ERROR_MISDIRECTED(421, "request.error.misdirected"),//             ▪ 421Misdirected Request
    REQUEST_ERROR_UNPRROCESSABLE(422, "request.error.unprocessable"),// ▪ 422 Unprocessable Entity
    REQUEST_ERROR_LOCKED(423, "request.error.locked"),// ▪ 423 Locked
    REQUEST_ERROR_FAILED_DEPENDENCY(424, "request.error.faileddependency"),// ▪ 424 Failed Dependency
    REQUEST_ERROR_TOO_EARLY(425, "request.error.tooearly"),// ▪ 425 Too Early
    REQUEST_ERROR_UPGRADE_REQUIRED(426, "request.error.upgraderequired"),// ▪ 426 Upgrade Required
    REQUEST_ERROR_RETRY_WITH(449, "request.error.retrywith"),// ▪ 449 Retry With
    REQUEST_ERROR_UNAVAILABLE_FOR_LEGAL_REASONS(451, "request.error.unavailableforlegalreasons"),// ▪ 451 Unavailable For Legal Reasons


    //服务器错误 Server error


    SERVER_ERROR_INTERNAL(500, "server.error.internal"),//    500 Internal Server Error
    SERVER_ERROR_NOT_IMPLEMENTED(500, "server.error.notimplemented"),//▪ 501 Not Implemented
    SERVER_ERROR_BAD_GATEWAY(500, "server.error.badgateway"),//▪ 502 Bad Gateway
    SERVER_ERROR_UNAVAILABLE(500, "server.error.unavailable"),//▪ 503 Service Unavailable
    SERVER_ERROR_GATEWAY_TIMEOUT(500, "server.error.gatewaytimeout"),//▪ 504 Gateway Timeout
    SERVER_ERROR_NOT_VERSION_SUPPORTED(500, "server.error.versionnotsuported"),//▪ 505 HTTP Version Not Supported
    SERVER_ERROR_VARIANT_ALSO_NEGOTIATES(500, "server.error.variantalsonegotiates"),//▪ 506 Variant Also Negotiates
    SERVER_ERROR_INSUFFICIENT_STORGE(500, "server.error.insufficientstorage"),//▪ 507 Insufficient Storage
    SERVER_ERROR_BANDWIDTH_LIMIT_EXCEEDED(500, "server.error.bandwidthlimitexceeded"),//▪ 509 Bandwidth Limit Exceeded
    SERVER_ERROR_NOT_EXTENDED(500, "server.error.notextended"),//▪ 510 Not Extended
    SERVER_ERROR_UNPARSEABLE_RESPONSE_HEADERS(500, "server.error.unparseableresponseheaders");//▪ 600 Unparseable Response Headers

    // 返回码
    private int code;

    // 返回信息
    private String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
